<template>
		<u-popup class="popupcss" :show="boxshow" mode="center" :round="20" zIndex="900" :overlayStyle=overlayStyle @close="close()">
			<view class="orderContent colCen">
				<view class="boxtitle">
					抢单说明
				</view>
		
				<view class="greytxt">
					应美团要求，该活动需通过手机号报名，否则无法获得返利
				</view>
		
				<view class="iptarea rowCen wd100bd">
					<u-input type="number" class="wd100bd" border="none" clearable v-model="phone" placeholder="请填写手机号" />
				</view>
		
				<view class="txtbox">
					<span style="color: red;">请填写美团外卖下单账号绑定的手机号，如报名帐号和下单账号不一致无法获得返现</span>
					<text style="color: #FE7C0C;">
						如何确认?
					</text> <br>
					请先报名后下单。<br> 请在报名后60分钟内下单。<br> 报名后不可改绑美团绑定的手机号
					<br> 报名后如不需要请取消报名
					<br> <span style="color: red;">多次恶意报名后不下单将会取消账号下单权限</span>
				</view>
		
				<view class="btnbar wd100bd rowCenBet">
					<view class="cancel rowCenCen btnstyle" @click="close()">
						暂不报名
					</view>
		
					<view class="cnfbtn rowCenCen btnstyle" @click="confirm()">
						确认报名
					</view>
				</view>
			</view>
		</u-popup>
	
</template>

<script>
	export default {
		data() {
			return {
				phone: '',
				boxshow: false,
				overlayStyle:{
					zIndex:400
				}
			}
		},
		methods: {
			show(info) {
				let phone = uni.getStorageSync('odphone');
				if(phone != "")this.phone = phone
				this.boxshow = true
			},
			confirm() {
				if(!this.phone){
					uni.showToast({
						icon:'none',
						title:'手机号不能为空！'
					})
					return
				}
				uni.showModal({
					title:'提示',
					content:'确认手机号无误并下单?',
					showCancel:true,
					success: (res) => {
						if(res.confirm){
							this.close()
							uni.setStorageSync('odphone',this.phone)
							this.$emit('confirmOrder', this.phone)
						}
					}
				})
			},
			close() {
				this.boxshow = false
			},
		}
	}
</script>

<style scoped lang="scss">
	.orderContent {
		width: 580rpx;
		border-radius: 20rpx;
		overflow: hidden;
		padding: 31rpx 46rpx;

		.boxtitle {
			margin-top: 20rpx;
			font-weight: bold;
			font-size: 32rpx;
			color: #333333;
		}

		.greytxt {
			text-align: center;
			margin-top: 30rpx;
			font-weight: 500;
			font-size: 26rpx;
			color: #666666;
			line-height: 36rpx;
		}

		.iptarea {
			height: 80rpx;
			background: #F9F9F9;
			border-radius: 10rpx;
			font-weight: bold;
			font-size: 30rpx;
			color: #333333;
			margin-top: 30rpx;
			padding: 0 30rpx;
		}

		.txtbox {
			margin-top: 30rpx;
			font-weight: 500;
			font-size: 24rpx;
			color: #666666;
			line-height: 40rpx;
		}

		.btnbar {
			margin-top: 30rpx;

			.btnstyle {
				width: 225rpx;
				height: 82rpx;
				font-weight: 500;
				font-size: 28rpx;
				border-radius: 41rpx;
			}

			.cancel {
				border: 1rpx solid #DFDEDE;
				color: #333333;
			}

			.cnfbtn {
				background: #FE7C0C;
				color: #fff;
			}
		}
	}
</style>